Don't bother sorting build scripts
authorAlex Crichton <alex@alexcrichton.com>
Sun, 4 Oct 2015 19:02:33 +0000 (12:02 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Mon, 5 Oct 2015 18:32:58 +0000 (11:32 -0700)
Turns out the tests don't actually need this "more deterministic" output and it
was also showing up relatively high in profiles (e.g. ~15% of a noop runtime) so
if this is necessary let's find a better way!

src/cargo/ops/cargo_rustc/custom_build.rs
tests/test_cargo_test.rs

index 7967a1a4d36d35b6a86d92ab6630929680925dd1..1232fa9c21ae1a85a38581ef049d42cb7ceee768 100644 (file)
@@ -338,14 +338,6 @@ pub fn build_map<'b, 'cfg>(cx: &mut Context<'b, 'cfg>,
     for unit in units {
         build(&mut ret, cx, unit);
     }
-
-    // Make the output a little more deterministic by sorting all dependencies
-    for (_, slot) in ret.iter_mut() {
-        slot.to_link.sort_by(|a, b| a.0.cmp(&b.0));
-        slot.to_link.dedup();
-        slot.plugins.sort();
-        slot.plugins.dedup();
-    }
     cx.build_scripts.extend(ret.into_iter().map(|(k, v)| {
         (k, Arc::new(v))
     }));
index 9e9cd678e6600096cb5b7c2aab333de2a09b9239..7a269f26adc99ede60f3492a268e302337bda754 100644 (file)
@@ -2017,7 +2017,7 @@ test!(bin_does_not_rebuild_tests {
                 execs().with_status(0)
                        .with_stdout(&format!("\
 {compiling} foo v0.0.1 ([..])
-{running} `rustc src/main.rs [..]`
-{running} `rustc src/main.rs [..]`
+{running} `rustc src[..]main.rs [..]`
+{running} `rustc src[..]main.rs [..]`
 ", compiling = COMPILING, running = RUNNING)));
 });